A conventional interfaced software object provides software services, such as methods or properties, that are accessed by one or more interfaces. A method is typically a function or procedure that performs a specific action and is called via a corresponding interface. A property is typically information or data and is also called via a corresponding interface. Objects are commonly implemented in a server that, for example, may be a dynamic link library utilized by a software program or may be an entirely separate executable process.
Conventional objects include the characteristic of interface inheritance in which the definitions of the methods that an interface supports may be inherited by another interface. The interfaces may be of different objects that may or may not be of the same class of objects. An object supporting an inherited interface can be treated like the object from which the interface is inherited. Such objects may be implemented by or in accordance with many object-oriented programming tools or models including, for example, the component object model (COM).
An interface of an object may not be changed once the design and implementation of the interface is complete and the object is established, distributed, or promulgated for general run-time use. Adding new services to or modifying existing services in such an object requires that a new interface be defined in a design-time operation. The new interface would then be distributed or promulgated for general run-time use. The new interface may inherit services from an existing interface, but the new interface remains distinct and has a unique identifier. Despite interface inheritance, therefore, interfaces remain static once they have been established, distributed, or promulgated for use at run-time.
While providing stability and predictability in the use of objects, the static nature of interface services at run-time limits the flexibility of object interfaces. In some applications the lack of flexibility in interface definitions can pose an undesirable limitation. An example of such an application is an interactive virtual world environment that represents a real or imaginary place using graphic and audio data for presenting the place to a computer user and allowing the user to interact with it.
Objects with conventional static interfaces can be used to provide users of a virtual world environment with a predefined environment with which the user can interact. A disadvantage with objects having conventional static interfaces in such an environment is that changes to the environment cannot be made at run-time. Changes must be made by adding interfaces in a design-time operation. This restricts the level of interaction or control that users can have with or over the environment.
In accordance with the present invention, therefore, object services like methods or properties are provided to or inherited by objects dynamically during run-time. This dynamic inheritance may be provided within the context of an object model, such as the Component Object Model, that supports only design-time interface inheritance. As applied in a virtual world environment, for example, dynamic inheritance can provide users with increased levels of interaction or control.
In a method of providing dynamic inheritance, hierarchical relationships are defined between multiple objects such that each object references or is referenced by another object. One of the objects is a root object that is referenced by at least one other object but that does not reference another object. A call is made for a particular service (e.g., a method or property) at a selected object. The service is provided directly from the object whenever the service is available therefrom.
Whenever the selected service is unavailable at the selected object, the call is passed to a referenced object (i.e., an object that is referenced by the selected object). The service is provided directly from the referenced whenever the service is available therefrom or the call is passed to yet another referenced object until the service can be provided. The call may be passed to multiple successive referenced objects until the call reaches the root object, which either provides the service or the service is deemed unavailable.
Another aspect of dynamic inheritance is that an object model interface may include one or more methods for adding or otherwise changing the methods or properties available from that interface. The changes in the methods or properties may be made at run-time, after the interface has been otherwise fixed or established.
In one implementation, the interface includes an AddMethod method that adds a designated method to the interface at run-time to make the method available from the interface. Similarly, the interface includes an AddProperty method that adds a designated property to a designated interface at run-time to make the property available from the interface. An InvokeMethod method allows a user to execute the designated method, and other methods can allow other access to and control over the methods and properties. Methods and properties available for implementation or access by these dynamic inheritance methods may be in a dynamic inheritance listing, such as a table, that indicates the names of the methods and properties, defines the services they provide, and includes unique identifiers for them.
Additional objects and advantages of the present invention will be apparent from the detailed description of the preferred embodiment thereof, which proceeds with reference to the accompanying drawings.